import Axios from 'axios'

export function request (config) {
  const instance = Axios.create({
    baseURL: 'http://82.156.29.162:8888',
    timeout: 5000
  })

  return instance(config)
}

// 通过月份分组查询 客流量
export function findByMonthDay (name) {
  return request({
    url: '/findByMonthDay',
    method: 'post',
    params: {
      month: name
    }
  })
}
// 查询用户年龄结构
export function findAgeStructure () {
  return request({
    url: '/findAgeStructure',
    method: 'post'
  })
}

// 查询某个月单个站点的进出人数
export function findByOneMonthStationInOut (name, value) {
  return request({
    url: '/findByOneMonthStationInOut',
    method: 'post',
    params: {
      month: name,
      station: value
    }
  })
}

// 查询一天的天气情况
export function findWeatherByDay (month, day) {
  return request({
    url: '/findWeatherByDay',
    method: 'post',
    params: {
      month: month,
      day: day
    }
  })
}

// 查询一个月的天气情况
export function findWeatherByMonth (month) {
  return request({
    url: '/findWeatherByMonth',
    method: 'post',
    params: {
      month: month
    }
  })
}

// 单周每天的客流量
export function findByWeek () {
  return request({
    url: '/findByWeek',
    method: 'post',
    params: {
      week: 3
    }
  })
}
/* //查询单独每天的天气情况
  export function findWeatherByDay(month, day){
    return request({
      url: '/findWeatherByDay',
      method: 'post',
      params: {
        month: month,
        day: day,
      }
    })

} */
// 请求一天中各个时刻的入站和出站人数
export function findEveryTimeInOut () {
  return request({
    url: '/findEveryTimeInOut',
    method: 'post'
  })
}
// 桑基图
export function findAllTripsStation () {
  return request({
    url: '/findAllTripsStation',
    method: 'get'
  })
}
// 请求票价对应的人数
export function findTicketsAndPeople () {
  return request({
    url: '/findTicketsAndPeople',
    method: 'post'
  })
}
// 请求一个星期各天出入站人数
export function findWeekInOut () {
  return request({
    url: '/findWeekInOut',
    method: 'post'
  })
}

// 返回站台时段流量图
export function findTimeNum () {
  return request({
    url: '/findTimeNum',
    method: 'post'
  })
}
// 返回聚类图数据
export function cluster1 () {
  return request({
    url: '/cluster1',
    method: 'post'
  })
}
// 单个站台流量走势图
export function stationChaneByDay () {
  return request({
    url: '/stationChaneByDay',
    method: 'post'
  })
}
